package com.meida.module.bus.provider.service;


import com.meida.common.mybatis.base.service.IBaseService;
import com.meida.common.mybatis.entity.EntityMap;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.module.bus.client.entity.BusMaterialPackage100;
import com.meida.module.bus.client.entity.srmapi.srmtopms.SrmPms04Req;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 100分包 接口
 *
 * @author flyme
 * @date 2020-10-10
 * @date 2020-10-09
 */
public interface BusMaterialPackage100Service extends IBaseService<BusMaterialPackage100> {

    BusMaterialPackage100 getlevelNo(String levelNo);

    List<Long> getinitPlanIds(Long projectId);

    ResultBody copyAndUpdate(Map map);

    //按分组修改所有临时版本（分新增/修正类型）的申请状态
    Boolean updateApplayStatus(Long projectId,String packageNo,String majorCode,Integer planType,Integer applayStatus);

    ResultBody subArchive200OaCheck(Map map);

    ResultBody goArchive200(Long projectId, Integer checkState);

    //提交合并数据到oa审核
    ResultBody subMerge100OaCheck(Map map);

    //oa 审核成功后进行合并操作
    ResultBody goMerge100(Long projectId,String packageNo,String majorCode, String userName) throws Exception;

    List<EntityMap> selectPackage100Details(Map map);

    //查询根节点数据
    List<EntityMap> selectPackage100RootDetails(Map map);

    List<BusMaterialPackage100> selectPackage100DetailData(Map map);

    //导入更新数据，更新包商量
    ResultBody importOnUpdateBusMaterialPackage100Data(MultipartFile file, Map params);

    //导入新数据
    ResultBody importOnAddBusMaterialPackage100Data(MultipartFile file, Map params);

    //月报里判断展示100分包分页,还是200分包分页
    ResultBody getPackagePageList(Map params);

    //按照分组字段进行分组projectId,packageNo,majorCode,topParentId
    List<BusMaterialPackage100> getByGroup4Field(Map params);

    //按照分组字段进行分组projectId,packageNo,majorCode
    List<BusMaterialPackage100> getByGroup3Field(Long projectId);

    //工程量和包商量累加
    EntityMap sumByField(Long projectId, String majorCode, String packageNo, Long parentId);

    //单一包商累积量
    EntityMap sumSupplierNum(Long projectId, String majorCode, String packageNo, String SupplierNumField);

    int totalByProject(Long projectId);

    int totalByProjectAndVersionStatus(Long projectId, Integer versionStatus);

    //分承包合同下达
    ResultBody getSrmPms05Req(Map map) throws Exception;

    //分承包合同下达-审批
    ResultBody getSrmPms05ReqForApproval(Map map);

    //某项目分组所有版本信息
    List<EntityMap> selectVersionList(Map map);

    //某项目分组 所有的包商合同量
    EntityMap getAllSupplierNum(Map map);

    //某项目分组下临时版本数据
    List<BusMaterialPackage100> selectBusMaterialPackage100List(Long projectId, String majorCode, String packageNo);

}
